Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #445 by adding a animated search component #459

Merged

Conversation

KartikChawla09
Copy link
Contributor

Linked Issue(s)

Closes #445

Acceptance Criteria fulfillment

  • try not to add any additional packages
  • theme must be kept similar to the pre-existing UI
  • write optimized and efficient code

Proposed changes (including videos or screenshots)

Slide.Animation.mp4

@KartikChawla09
Copy link
Contributor Author

@e-for-eshaan I have closed the previous PR and made a new one. Please review this one.


const AnimatedRepos = () => {
const [animationIndex, setAnimationIndex] = useState(0);
const [repos] = useState(popRepos);
Copy link
Contributor

@e-for-eshaan e-for-eshaan Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simply use popRepos. It's a global constant and can be utilized without having to pass into a state. Just remove this line of code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made this change, now using just popRepos.

.placeholder{
border: none;
outline: none;
right: 0px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

element isn't relative, nor absolute, why are we using right: 0px;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unnecessary styling in the latest commit

Comment on lines 11 to 14
<input
className={styles.placeholder}
style={{ backgroundColor: themeColors.primaryAlt }}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you rendering this input? it doesn't seem to show up anywhere.
I guess you need to add some width and height to the <div> component in AnimatedInputWrapper component, and remove input completely.

Feel free to ask more about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used a div instead of input in the latest commit

@@ -0,0 +1,29 @@
.animationWrapper{
position: absolute;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are using absolute position, but the parent (element wrapping this component) isn't having relative position.
this can cause unexpected behaviour when you are trying to debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave position:relative to .placeholder which was the parent element of .animationWrapper

className={styles.text}
style={{ bottom: animationIndex * 1.4 + 'em' }}
>
{repos.map((item) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then this becomes popRepos.map

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

) : !searchFocus.value ? (
<AnimatedInputWrapper />
) : (
'org/repo'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

it should have said Search for org/repo
#448 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@e-for-eshaan e-for-eshaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@KartikChawla09
Copy link
Contributor Author

LGTM!

Can you please merge the PR?

@e-for-eshaan e-for-eshaan merged commit febd561 into middlewarehq:main Jul 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add search suggestions for repo-search
2 participants